import { request } from '@/utils/request';

const Api = {
  List: '/recharge/channel/list',
  add: '/recharge/channel',
  info: '/recharge/channel',
  dictionaries: '/system/dict/data/type/channel_type',
};

// 列表
export function getChannelList(params: any) {
  return request.get({
    url: Api.List,
    params,
  });
}

// 添加
export function add(data: any) {
  return request.post({
    url: Api.add,
    data,
  });
}

// 详情
export function getInfo(id: number | string) {
  return request.get({
    url: `${Api.info}/${id}`,
  });
}

// 修改
export function edit(data: any) {
  return request.put({
    url: Api.add,
    data,
  });
}

// 删除
export function Delete(id: number | string) {
  return request.delete({
    url: `${Api.add}/${id}`,
  });
}

// 字典
export function getDictionaries(params: any) {
  return request.get({
    url: Api.dictionaries,
    params,
  });
}
